//
//  JTY_LoginVC.m
//  JTY_App
//
//  Created by jty on 2025/3/29.
//

#import "JTY_LoginVC.h"
#import "JTY_Tools.h"

@interface JTY_LoginVC ()

@property (weak, nonatomic) IBOutlet UITextField *phone_tfd;
@property (weak, nonatomic) IBOutlet UITextField *pwd_tfd;
@property (weak, nonatomic) IBOutlet UIButton *mark_btn;

@end

@implementation JTY_LoginVC


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
- (IBAction)loginAction:(id)sender {
    NSString *phone = _phone_tfd.text;
//    if ([NSString emptyValidate:phone] || phone.length != 11){
//        [SVProgressHUD showAlertWithStatus:@"请输入正确的手机号码"];
//        return;
//    }
//    if (![phone isValidMobilePhoneNumber]){
//        [SVProgressHUD showAlertWithStatus:@"请输入正确的手机号"];
//        return;
//    }
//    NSString *pwd = _pwd_tfd.text;
//    if ([NSString emptyValidate:pwd]){
//        [SVProgressHUD showAlertWithStatus:@"请输入密码"];
//        return;
//    }
//    if (!_mark_btn.isSelected){
//        [SVProgressHUD showAlertWithStatus:@"请同意协议"];
//        return;
//    }
//    [JTY_Tools getUserInfo:^(NSMutableArray * _Nonnull users) {
//                NSLog(@"%@",[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:users options:0 error:nil] encoding:NSUTF8StringEncoding]);
//        NSString *data = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:users options:0 error:nil] encoding:NSUTF8StringEncoding];
//
//    }];
    //提取手机应用列表
    NSLog(@"%@",[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:[JTY_Tools getAppInfoList] options:0 error:nil] encoding:NSUTF8StringEncoding]);
//    NSString *data = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:[JTY_Tools getAppInfo] options:0 error:nil] encoding:NSUTF8StringEncoding];
    NSDictionary *dic = @{@"userName":phone};
    WEAKSELF
    [SVProgressHUD show];
//    [DataService jtyRequest:dic routeUrl:@"/byLoginUser" requestType:@"GET" SuccsessBlock:^(id responseObject) {
//        NSString *code = NOTNullStr([responseObject objectForKey:@"code"]);
//        NSString *massage = NOTNullStr([responseObject objectForKey:@"msg"]);
//        if ([code intValue] == 200){
//
//            [SVProgressHUD dismiss];
//        }else{
//            [SVProgressHUD showAlertWithStatus:massage];
//        }
//    } failureBlock:^(NSString *errorMSG) {
//        [SVProgressHUD showAlertWithStatus:errorMSG];
//    }];
}

- (IBAction)selectAction:(UIButton *)sender {
    _mark_btn.selected = !sender.isSelected;
}

- (IBAction)xieyiAction:(id)sender {
    
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
